//package com.example.publishDemo.Controller;
//
//import com.example.publishDemo.Controller.SystemMessage.SystemMessageConsumer;
//import com.example.publishDemo.Controller.SystemMessage.SystemMessageProducer;
//import com.example.publishDemo.Model.AjaxResult;
//import com.example.publishDemo.Model.MessageInfo;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import java.util.HashMap;
//
//@CrossOrigin
//@RestController
//@RequestMapping("/message")
//public class MessageController {
//
//    @Resource
//    SystemMessageProducer systemMessageProducer;
//
//    @Resource
//    SystemMessageConsumer systemMessageConsumer;
//
//    @PostMapping("/producerSystemMessage")
//    public AjaxResult producerSystemMessage(@RequestBody HashMap<String,Object> map){
//        String routingKey =(String) map.get("routingKey");
//        System.out.println(map.get("message"));
//        MessageInfo message = (MessageInfo) map.get("message");
//
//
////        systemMessageProducer.sendSystemMessage(routingKey, message);
//
//        return AjaxResult.success(true);
//    }
//
//    @GetMapping("/consumerSystemMessage")
//    public AjaxResult consumerSystemMessage(@RequestParam String routingKey,MessageInfo message){
//        systemMessageProducer.sendSystemMessage(routingKey, message);
//
//        return AjaxResult.success(true);
//    }
//}
